Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimisation: edit operation takes 4.5s in large sheets #649

Merged
merged 9 commits into from
Dec 17, 2024

Conversation

Corbe30
Copy link
Contributor

@Corbe30 Corbe30 commented Dec 13, 2024

Optimizations performed in this PR for 7k rows and 1,00,000+ formulas:

Changes Time
no changes 4-5sec
getFlowdata + shallow clone 3.5sec
formulaArrayCache ~4mb 1.3sec (from 2nd edit)
updateFormulaCache ~19mb 700-900ms

@Corbe30
Copy link
Contributor Author

Corbe30 commented Dec 16, 2024

renaming variables and functions:
formulaArray -> FormulaDependency
formulaArrayCache -> FormulaDependenciesMap
formulaObject -> FormulaCellInfo
formulaObjects -> FormulaCellInfoMap

@Corbe30
Copy link
Contributor Author

Corbe30 commented Dec 16, 2024

removed FormulaDependenciesMap (formulaArrayCache) - it is only useful for cut-paste operation or large duplicate functions addition - which is not in scope of this PR.

@Corbe30
Copy link
Contributor Author

Corbe30 commented Dec 16, 2024

Useful undo/redo test cases:

  1. delete formula > undo > change dependency
  2. delete formula > undo > change dependency in another sheet
  3. delete dependency > undo > change dependency > observe chain formulas
  4. replace formula with fill handle > undo > change dependency
  5. delete row/col(s) > undo > change dependency
  6. inside a NEW sheet: add formula > undo > change old dependency (value object test case)
  7. inside a OLD sheet: add formula > undo > change old dependency (null check test case)
  8. in a sheet1 - define A1 = 1, B1 = '=A1+10'. fill handle C1 and D1 from B1. do this again in sheet2. modify dependency > it doesn't modify formulas in sheet2.
  9. add formula > delete sheet > undo > change dependency

@Corbe30 Corbe30 changed the title (do not merge) optimisation: edit operation takes 4.5s in large sheets Optimisation: edit operation takes 4.5s in large sheets Dec 16, 2024
@sanchit3008 sanchit3008 merged commit afb4d28 into ruilisi:master Dec 17, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants